import request from '@/utils/request'

// 查询客户地址管理列表
export function listAddress(query) {
  return request({
    url: '/tms/address/list',
    method: 'get',
    params: query
  })
}

// 查询客户地址管理列表
export function listUniAddress(query) {
  return request({
    url: '/tms/address/listUni',
    method: 'get',
    params: query
  })
}

// 查询客户地址管理列表
export function listAddressCustName(query) {
  return request({
    url: '/tms/address/listCustName',
    method: 'get',
    params: query
  })
}

// 查询客户地址管理详细
export function getAddress(pkid) {
  return request({
    url: '/tms/address/' + pkid,
    method: 'get'
  })
}

// 新增客户地址管理
export function addAddress(data) {
  return request({
    url: '/tms/address',
    method: 'post',
    data: data
  })
}

// 修改客户地址管理
export function updateAddress(data) {
  return request({
    url: '/tms/address',
    method: 'put',
    data: data
  })
}

// 删除客户地址管理
export function delAddress(pkid) {
  return request({
    url: '/tms/address/' + pkid,
    method: 'delete'
  })
}


// 查询省份
export function getProvinces() {
  return request({
    url: '/tms/area/getProvinces?pageNum=1&pageSize=9999',
    method: 'get'
  })
}

// 查询四级地址表列表
export function getChildArea(areaParentId) {
  return request({
    url: '/tms/area/getChildArea/' + areaParentId+'?pageNum=1&pageSize=9999',
    method: 'get'
  })
}

// 查询客户列表
export function getCustomerNameList(query) {
  return request({
    url: '/tms/saleOrder/seletCustomerNameList',
    method: 'get',
    params: query
  })
}


// 查询客户地址管理列表
export function listEcCust(data) {
  return request({
    url: '/tms/deliCustomer/list',
    method: 'post',
     data: data
  })
}
